/*
Project Name : Menfram
Module Name  : DAO
Date  : 07/06/2013
responsible : Mateus Neto
Obs  : The license of this software is Mozilla Public License 1.1 
contact : mentrixmax@gmail.com
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Collections;
using Menfram.Entity.Interface;

namespace Menfram.DAL.Interface
{
    public interface IDAL<T>
    {
        
        
        /// <summary>
        /// get the First Record the table of the database order by Key
        /// </summary>
        /// <returns></returns>
        T getFirst();

        /// <summary>
        /// get the Last Record the table of the database order by Key
        /// </summary>
        /// <returns></returns>
        T getLast();

        /// <summary>
        /// get the Next the table of the database order by Key
        /// </summary>
        /// <param name="KeyCurrent"></param>
        /// <param name="SequenceCurrent"></param>
        /// <returns></returns>
        T getNext(String KeyCurrent, String SequenceCurrent);

     
        /// <summary>
        /// get the Prior the table of the database order by Key
        /// </summary>
        /// <param name="KeyCurrent"></param>
        /// <param name="SequenceCurrent"></param>
        /// <returns></returns>
        T getPrior(String KeyCurrent, String SequenceCurrent);

        /// <summary>
        /// get the Entity by Key 
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        T findByKey(String key);

        /// <summary>
        /// get the Entity by Sequence
        /// </summary>
        /// <param name="chave"></param>
        /// <returns></returns>
        T findById(int? Sequence);

        /// <summary>
        /// returns all records of the table.
        /// </summary>
        /// <returns></returns>
        IList<T> findAll();

        /// <summary>
        /// returns the records of the table Meets that the specified filter
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        IList<T> findByParameters(T entity);

        /// <summary>
        /// the update record in the database
        /// </summary>
        /// <param name="entidade"></param>
        /// <returns></returns>
        bool update(T entity);

        /// <summary>
        /// create record in the database
        /// </summary>
        /// <param name="entidade"></param>
        /// <returns></returns>
        bool create(T entity);

        /// <summary>
        /// delete record in the database
        /// </summary>
        /// <param name="entidade"></param>
        /// <returns></returns>
        bool delete(int? id);

       
        /// <summary>
        /// get the sequence by key
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        int? getId(T entity);

        
    }
}
